<?php
class Catalog_model extends CI_Model {
	public $table_name = 'cata_log';
    public function get_entries(){
        $query = $this->db->get('cata_log');
        return $query->result();
    }
    public function get_one($id){
        $query = $this->db->where('id',$id)->get($this->table_name);
        return $query->row();
    }
    public function add_one($data){
       $this->db->insert($this->table_name, $data);
    }
    public function edit_one($id,$data){
        $this->db->where('id', $id)->update($this->table_name, $data);
    }
     public function del_one($id){
      $this->db->delete($this->table_name, array('id' => $id));
    }
}